package com.gxm.base.grammar_运算语法.lambda;

import org.junit.Test;

public class LambdaDemo {
    @Test
    public void test(){
        CloseDoor closeDoor = new CloseDoor();
        closeDoor.doClose(()->{ System.out.println("lambda关门");});
    }
}

@FunctionalInterface
interface CloseInt{
    void close();
}

class CloseDoor{
    public void doClose(CloseInt c){
       c.close();
    }
}
